package com.example.module_notice.ui.notice

import com.example.module_notice.api.MotorCircleNetModule
import com.example.module_notice.api.NoticeApiService
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject


class NoticeRepository @Inject constructor(){
    @Inject
    @MotorCircleNetModule.NoticeApi
    lateinit var apiService: NoticeApiService

    fun getAnnouncementByUserId(userId : Int) = flow {
        emit(apiService.getAnnouncementByUserId(userId))
    }.flowOn(Dispatchers.IO)
    fun getAnnouncementsDetail(id : Int) = flow {
        emit(apiService.getAnnouncementsDetail(id))
    }.flowOn(Dispatchers.IO)

}